<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="dad">
        <div class="baby">x</div>
    </div>

    <script>

        const baby = document.querySelector('.baby')
        console.log(baby);//返回 <div class="baby">x</div>
        console.log(baby.parentNode);//返回<div class="dad">


    </script>


</body>

</html>